package com.netease.spring.ch2;

import com.netease.spring.exceptions.PerformanceException;

public class Instrumentalist implements Performer {
    private String song;

    private Instrument instrument;

    /**
     * @param song
     *            the song to set
     */
    public void setSong(String song) {
        this.song = song;
    }

    /**
     * @param instrument
     *            the instrument to set
     */
    public void setInstrument(Instrument instrument) {
        this.instrument = instrument;
    }

    public Instrumentalist() {
        super();
    }

    @Override
    public void perform() throws PerformanceException {
        System.out.println("Playing " + song + ":");
        instrument.play();
    }
}
